<!--partner_customer_info-->
<style>
.custom-shape img {
  width: 80%;
}
.custom-shape-radio label {
  display: block;
  margin-bottom: .8em;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
table input[type=radio] {
  margin: 0 0.3em;
}

/*切换编辑模式和视图模式*/
.view-mode .val,
.edit-mode input,
.edit-mode select,
.edit-mode .radio-img,
.edit-mode .custom-shape-radio {
    display: none;
}
.edit-mode .val{
    display: inline-block;
}
.view-mode input,
.view-mode select,
.view-mode .radio-img,
.view-mode .custom-shape-radio {
    display: block;
}
.view-mode input[type=radio] {
    display: inline-block;
    margin-right: .3em;
}
.list-cont tr{
    border-bottom: 1px solid #e3e3e3;
    text-align: center;
}
.list-cont th{
    background: #E8E9EB;
    font-weight: normal;
}
.list-cont .item-head {
    background: #F0F5F8;
    border: 1px solid #e3e3e3;
    text-align: left;
}
.list-cont .item-detail td {
    border: 1px solid #e3e3e3;
}
.list-cont .link {
  color: #369;
  text-decoration: underline;
}
</style>
<style>
    .custom-shape img {
        width: 80%;
        margin: .5em 0 1em;
    }
    .custom-shape-radio label {
        display: block;
        margin-bottom: .8em;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    input[type=radio] {
        margin: 0 0.3em;
    }
    .customer-research input {
        margin-right: .5em;
        width: 50%;
        vertical-align: top;
    }
    .product-info tr {
        border-top: 1px solid# e3e3e3;
    }
    .product-info th {
        background-color: #e8e9eb;
        font-weight: normal;
    }
    .order-checkout {
        margin-top: 2em;
    }
    .customer-list {
        margin-bottom: 2em;
    }
    .customer-list tr {
        border-bottom: 1px solid# e3e3e3;
    }
    .order-comment {
        width: 100%;
        min-height: 100px;
        resize: vertical;
        padding: .2em 0.2em.3em;
        border: 1px solid# ccc;
    }
    .payment-method {
        padding-bottom: 2em;
    }
    .payment-method label input {
        margin-right: .5em;
    }
    .count-num {
        padding: 0.5em;
    }
    .choose-customer-btn.btn {
        margin-left: 1em;
        margin-right: 1em;
        padding-left: 2em;
        padding-right: 2em;
    }

    /*选择商品*/
    .product-detail-select td {
        width: 200px;
    }
    .product-detail-select hr,
    .product-tabs hr {
        height: 0;
        border: none;
        border-bottom: 1px solid# ccc;
        margin: 0;
    }
    .product-tabs ul {
        padding: 0 2em;
    }
    .product-tabs li {
        width: 200px;
        margin: 1px 2em -1px 2em;
    }
    .product-tabs .curs {
        background: #fff;
        color: inherit;
        border: 1px solid #ccc;
        border-bottom: none;
    }
    .preview-img {
        width: 220px;
        padding: 2em 1em 2em 0;
    }
    .view-mode.val {
        display: inline-block;
    }
    .search-area p.error {
        float: left;
        line-height: 2;
        margin-right: 0.3em;
    }
    .cartShow td {
        vertical-align: middle;
    }
    .product-count-wrap .decrease,
    .product-count-wrap .increase {
        display: inline-block;
        width: 25px;
        height: 25px;
        background-color: #3eabb8;
        background-repeat: no-repeat;
        background-position: center center;
        font-size: 0;
        vertical-align: middle;
        cursor: pointer;
    }

    .product-count-wrap .decrease {
        background-image: url();
    }

    .product-count-wrap .increase {
        background-image: url();
    }
    #ID_select{
        padding: 4px 6px;
        border: 1px solid #ccc;
        color: #4a4a4a;
        vertical-align: middle;
        font:inherit;
        margin: 0;
    }

    .paterner-title {
        color: #828282;
        padding: 1em .6em;
        border-bottom: 1px solid #ccc;

    }
    .Garment_size .space{display: inline-block;
        margin: 0 5px;
    }
    tr{
        border-collapse: collapse;
        border-spacing: 0;
    }
    td{color: #999;
        padding: .5em .6em;
        vertical-align: top;
    }
    .Garment_size em {
        font-style: normal;
        color: #3eabb8;
    }
    .tab {
        position: relative;
        width: 100%;
        margin: 0 auto;
    }

    .tab-nav {
        width: 100%;
        height: 40px;
        margin-top: 16px;
        background: #e8e9eb;
    }
    .tab-nav a {
        float: left;
        width: calc( 100% /8 );
        height: 40px;
        line-height: 40px;
        text-align: center;
        text-decoration: none;
        color: #999;
    }

    .tab-nav a.current {

        background:#3eabb8;
        color: #fff;
    }

    .tab-con {
        position: relative;

        width:100%;

        height: auto;



        background: #fff;

    }

    .tab-con-item {

        display: none;

        width: 100%;

        height: auto;

        color: #000;

    }


</style>

<form name="customer_edit" action="<?php echo url('partner/customer_edit');?>" method="post">
  <?php include THEMES_PATH . 'partner/partner_create_customer.phtml';?>
  <input type="hidden" name="address_id" value="<?php echo $address['id'];?>">
  <input type="hidden" name="mid" value="<?php echo $measure['id'];?>">
  <input type="hidden" name="dosubmit" value="1">
</form>
<div class="order-list">
  <div class="partner-title">
    <strong><?php echo L('Order_list');?></strong>
    <span class="pull-right"><a class="btn" href="<?php echo url('partner/order_add',array('addrid'=>$address['id']));?>" target="_blank"><?php echo L('_Submit_an_order_');?></a></span>
  </div>
  <div class="list-cont">
    <table>
      <tr>
        <th><?php echo L('ordersn');?></th>
        <th><?php echo L('_name_');?></th>
        <th><?php echo L('goods_total');?></th>
        <th><?php echo L('paid_amount');?></th>
        <th><?php echo L('completed_order');?></th>
        <th><?php echo L('orderstatus');?></th>
        <th><?php echo L('_ACTION_');?></th>
      </tr>
      <?php foreach ($ordersList as $k => $order) : ?>
      <?php if($order['order_status'] != -2):?>
      <tr>
        <td><?php echo $order['order_sn'];?></td>
        <td><?php echo $order['delivery_first_name'].' '.$order['delivery_last_name'];?></td>
        <td><?php echo isset($order['order_amount']) ? currency($order['order_amount']) : null; ?></td>
        <td><?php echo isset($order['pay_amount']) ? currency($order['pay_amount']) : null; ?></td>
        <td><?php echo date('d-m-Y H:i:s',$order['start_time'])?></td>
        <td>
          <?php echo L(OrderModel::$orderStatus[$order['order_status']]);?> / <?php if($order['return_status']){ echo $order['return_status'];}else{echo L(OrderModel::$paymentStatus[$order['payment_status']]);}?> / <?php echo L(OrderModel::$shippingStatus[$order['shipping_status']]);?>
          <?php
          if($order['shipping_status'] == OrderModel::SHIPPING_UNSHIPPED){
          $orderslogs = array();
          $orderslogs = M('orders_log')->where(array('order_id' => $order['id']))->order('id DESC')->select();
            if($orderslogs){
                foreach($orderslogs as $kkk => $vvv){
                    if($vvv['shipping_status'] == 99){
                        echo '/ '.L('_PROCESSING_');
                        break;
                    }
                }
            }
          }
          ?>
        </td>
        <td>
          <a href="<?php echo url('partner/order_info', 'oid='.$order['id']);?>"><?php echo L('orderdetailed')?></a>
          <?php if($order['order_status'] == OrderModel::ORDER_UNCONFIRMED && $order['payment_status'] == OrderModel::PAY_UNPAYED) : ?>
          <br>
          <a href="javascript:;" title="<?php echo L('order_cancel');?>" data-order-id="<?php echo $order['id'];?>" class="js-cancel-order"><?php echo L('order_cancel')?></a>
          <?php endif; ?>
          <?php if($order['order_status'] == OrderModel::ORDER_UNCONFIRMED && $order['payment_status'] == OrderModel::PAY_UNPAYED) : echo isset($order['paymentSubmit']) ? $order['paymentSubmit'] : null; endif; ?>
        </td>
      </tr>
      <?php endif;?>
      <?php endforeach; ?>
    </table>
  </div>
</div>
<script>
$(function () {
  $(".edit-customer-info").removeClass("hide");
  $(document.body).on("click",".js-mode-btn",function(){
    var $this = $(this),
        _cont = $(".js-create-customer");

    $this.addClass("hide").siblings(".js-mode-btn").removeClass("hide");
    if (_cont.hasClass("view-mode")) {
      //点击保存按钮
      _cont.removeClass("view-mode").addClass("edit-mode");
      $.each(_cont.find("input"),function(){
        var _self = $(this);
        _self.siblings(".val").text(_self.val());
      });
      //保存表单信息 ajax提交...
      $('form[name="customer_edit"]').submit();
    } else {
      //点击编辑按钮
      _cont.addClass("view-mode").removeClass("edit-mode");
      $.each(_cont.find("input"),function(){
        var _self = $(this);
        _self.val(_self.siblings(".val").text);
      });
    }
  });
});
</script>
<script type="text/javascript">

    $(function() {
        $("#tab").rTabs();
        $("#tab2").rTabs({
            bind : 'click'
        });
    })
</script>
<script>


    $.fn.rTabs = function(options){
        //默认值
        var defaultVal = {
            btnClass:'.j-tab-nav',	/*按钮的父级Class*/
            conClass:'.j-tab-con',	/*内容的父级Class*/
            bind:'hover',	/*事件参数 click,hover*/
            animation:'0',	/*动画方向 left,up,fadein,0 为无动画*/
            speed:300, 	/*动画运动速度*/
            delay:200,	/*Tab延迟速度*/
            auto:false,	/*是否开启自动运行 true,false*/
            autoSpeed:0	/*自动运行速度*/
        };

        //全局变量
        var obj = $.extend(defaultVal, options),
            evt = obj.bind,
            btn = $(this).find(obj.btnClass),
            con = $(this).find(obj.conClass),
            anim = obj.animation,
            conWidth = con.width(),
            conHeight = con.height(),
            len = con.children().length,
            sw = len * conWidth,
            sh = len * conHeight,
            i = 0,
            len,t,timer;

        return this.each(function(){

            //判断动画方向
            function judgeAnim(){
                var w = i * conWidth,
                    h = i * conHeight;
                btn.children().removeClass('current').eq(i).addClass('current');
                switch(anim){
                    case '0':
                        con.children().hide().eq(i).show();
                        break;
                    case 'left':
                        con.css({position:'absolute',width:sw}).children().css({float:'left',display:'block'}).end().stop().animate({left:-w},obj.speed);
                        break;
                    case 'up':
                        con.css({position:'absolute',height:sh}).children().css({display:'block'}).end().stop().animate({top:-h},obj.speed);
                        break;
                    case 'fadein':
                        con.children().hide().eq(i).fadeIn();
                        break;
                }
            }

            //判断事件类型
            if(evt == "hover"){
                btn.children().hover(function(){
                    var j = $(this).index();
                    function s(){
                        i = j;
                        judgeAnim();
                    }
                    timer=setTimeout(s,obj.delay);
                }, function(){
                    clearTimeout(timer);
                })
            }else{
                btn.children().bind(evt,function(){
                    i = $(this).index();
                    judgeAnim();
                })
            }

            //自动运行
            function startRun(){
                t = setInterval(function(){
                    i++;
                    if(i>=len){
                        switch(anim){
                            case 'left':
                                con.stop().css({left:conWidth});
                                break;
                            case 'up':
                                con.stop().css({top:conHeight});
                        }
                        i=0;
                    }
                    judgeAnim();
                },obj.autoSpeed)
            }

            //如果自动运行开启，调用自动运行函数
            if(obj.auto){
                $(this).hover(function(){
                    clearInterval(t);
                },function(){
                    startRun();
                })
                startRun();
            }

        })

    }
</script>